package com.tsingsoft.mail.service.impl;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;

import com.tsingsoft.entity.EmailPool;
import com.tsingsoft.mail.dao.EmailPoolDao;
import com.tsingsoft.mail.dao.impl.EmailPoolDaoImpl;
import com.tsingsoft.mail.service.EmailPoolService;

public class EmailPoolServiceImpl implements EmailPoolService {
	
	EmailPoolDao dao = new EmailPoolDaoImpl();

	@Override
	public boolean deleteById(EmailPool ep) {
		return dao.deleteById(ep);
	}

	@Override
	public List<EmailPool> findById(EmailPool ep) {
		return dao.findById(ep);
	}

	@Override
	public boolean save(EmailPool ep) {
		String id = UUID.randomUUID().toString().replaceAll("-", "");
		ep.setId(id);
		Date createTime = new Date();
		ep.setCreateTime(createTime);
		return dao.save(ep);
	}

	@Override
	public boolean updateById(EmailPool ep) {
		return dao.updateById(ep);
	}
}
